# Use postgres/example user/password credentials
version: '3.9'

services:

  db:
    image: postgres:15 # pg_dump v15 ansible tasks
#    container_name: postgres
    hostname: postgres
    restart: always
#    deploy:
#      resources:
#        limits:
#          cpus: "4"
#          memory: 200M
    # set shared memory limit when using docker-compose
#    shm_size: 128mb
    # or set shared memory limit when deploy via swarm stack
#    volumes:
#      - type: tmpfs
#        target: /dev/shm
#        tmpfs:
#          size: 134217728 # 128*2^20 bytes = 128Mb
    environment:
      POSTGRES_PASSWORD: postgres
#      POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256"
#      POSTGRES_MAX_IDENTIFIER_LENGTH: 127
    ports:
      - '5432:5432'

## поднятие oracle контейнера с выводом портов и задать пользователя
#  oracle:
#    image: wnameless/oracle-xe-11g-r2
#    hostname: oracle
#    restart: always
#    ports:
#      - '1521:1521'
#    environment:
#      ORACLE_PASSWORD: oracle

# после запуска не останавливать контейнер
  playbook:
    image: ansible:latest
#    container_name: ansible_playbook
    hostname: ansible
#    restart: always
    volumes:
      - /Users/alexandr/IdeaProjects/ansible/tests/:/root
    entrypoint: sh ./run.sh localhost
    depends_on:
      - db




networks:
  tests:
    driver: local

#  adminer:
#    image: adminer
#    restart: always
#    ports:
#      - 8080:8080